//
//  HPBaseViewController.m
//  HappyPenguin
//
//  Created by zhuangyihang on 12/30/15.
//  Copyright © 2015 zhuangyihang. All rights reserved.
//

#import "HPBaseViewController.h"

@interface HPBaseViewController ()

@end

@implementation HPBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.baseContentView.backgroundColor = [UIConstants getAppBackgroundColor];
    self.baseNavigationBarView.backgroundColor = [UIConstants getAppColor];
    [self setStatusBarStyle:UIStatusBarStyleLightContent];
    [self setBaseNavigationBarColor:[UIColor whiteColor]];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (void)addBackButton:(SEL)selector{
    if (selector==nil) {
        [self addLeftButtonSelector:@selector(goBack)];
    }else{
        [self addLeftButtonSelector:selector];
    }
    
    [self setLeftButtonImage:[UIImage imageNamed:@"Back"]];
}

- (void)goBack{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)setupFullContentView{
    [self.baseContentView mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.view);
        make.size.equalTo(self.view);
    }];
    [self.view bringSubviewToFront:self.baseNavigationBarView];
    self.baseNavigationBarView.backgroundColor = [UIColor clearColor];
}
@end
